This is a notebook to begin to investigate the raw saturo data for the FFAR project
Load all of the spreadsheet information
Next, parse the “Site” column into Treatment, Block, and Triangle columns
head(sat_dat_melt)
## season FileName Time (min) Water Level (cm) Pressure (cm)
## 1 Fall MI-AD-7-10 (1).xlsx 1 4.06 0.945
## 2 Fall MI-AD-7-10 (1).xlsx 2 4.68 8.618
## 3 Fall MI-AD-7-10 (1).xlsx 3 4.68 8.729
## 4 Fall MI-AD-7-10 (1).xlsx 4 4.68 9.021
## 5 Fall MI-AD-7-10 (1).xlsx 5 4.68 9.150
## 6 Fall MI-AD-7-10 (1).xlsx 6 4.68 9.282
## Flux (cm/hr) Volume (mL/hr) Kfs KfsErr variable value
## 1 12.672 2311.559 32.0904 1.10268 Record ID 1050
## 2 112.824 20580.755 32.0904 1.10268 Record ID 1051
## 3 112.032 20436.283 32.0904 1.10268 Record ID 1052
## 4 113.868 20771.196 32.0904 1.10268 Record ID 1053
## 5 112.284 20482.251 32.0904 1.10268 Record ID 1054
## 6 113.364 20679.259 32.0904 1.10268 Record ID 1055
## L1 Site Treatment Block Triangle Bl_Tri
## 1 22-MI-AD-7-10 (1).xlsx-Fall MI AD 7 10 7_10
## 2 22-MI-AD-7-10 (1).xlsx-Fall MI AD 7 10 7_10
## 3 22-MI-AD-7-10 (1).xlsx-Fall MI AD 7 10 7_10
## 4 22-MI-AD-7-10 (1).xlsx-Fall MI AD 7 10 7_10
## 5 22-MI-AD-7-10 (1).xlsx-Fall MI AD 7 10 7_10
## 6 22-MI-AD-7-10 (1).xlsx-Fall MI AD 7 10 7_10
Then remove known bad stretches of data due to sensor failure
# wc_dat <- subset(wc_dat, !(Name == "WY_AD-11-12" & Port == 2))
# wc_dat <- wc_dat[!(wc_dat$Name == "MI-AD_9_1" & wc_dat$datetimeUTC < as_datetime("2022-8-15 19:00:00")), ]
# wc_dat <- wc_dat[!(wc_dat$Name == "MI-PR_9_9" & wc_dat$Port == 3 &
# wc_dat$datetimeUTC < as_datetime("2022-8-5 00:00:00") &
# wc_dat$datetimeUTC > as_datetime("2022-7-28 00:00:00")), ]
# wc_dat <- wc_dat[!(wc_dat$Name == "MI-PR_8_11" & wc_dat$Port == 3 &
# wc_dat$datetimeUTC < as_datetime("2022-7-16 18:00:00") &
# wc_dat$datetimeUTC > as_datetime("2022-7-16 12:00:00")), ]
# wc_dat <- wc_dat[!(wc_dat$Name == "RR_PR_4_7" & wc_dat$Port == 3 &
# wc_dat$datetimeUTC < as_datetime("2022-10-05 11:00:00") &
# wc_dat$datetimeUTC > as_datetime("2022-8-24 02:00:00")), ]
# wc_dat <- wc_dat[!(wc_dat$Name == "RR_PR_4_7" & wc_dat$Port == 3 &
# wc_dat$datetimeUTC < as_datetime("2022-12-07 13:00:00") &
# wc_dat$datetimeUTC > as_datetime("2022-11-04 12:00:00")), ]
Calculate the mean water content and the mean relative difference (relative to other sensors at that site and treatment) of each sensor
For hourly data:
# Calculate the mean and standard deviation of each sensor relative to other sensors in that site/treatment pair
# wc_dat_mean <- wc_dat %>% dplyr::group_by(Name, Site, Treatment, Block, Triangle, Port) %>%
# dplyr::summarize(avg_value = mean(value, na.rm = TRUE), sd_value = sd(value, na.rm = TRUE))
# wc_dat_mrd <- wc_dat %>% dplyr::group_by(Site, Treatment, Port, datetimeUTC) %>%
# dplyr::mutate(sp_avg_value = mean(value, na.rm = TRUE), sp_sd_value = sd(value, na.rm = TRUE))
# wc_dat_mrd$rd <- (wc_dat_mrd$value - wc_dat_mrd$sp_avg_value)/wc_dat_mrd$sp_avg_value
# wc_dat_mrd_mean <- wc_dat_mrd %>% dplyr::group_by(Name, Site, Treatment, Block, Bl_Tri, Triangle, Port) %>%
# dplyr::summarize(avg_rd = mean(rd, na.rm = TRUE), sd_rd = sd(rd, na.rm = TRUE))
… and for daily data:
# Reduce to daily data by extracting measurements from the noon hour only and repeat calculation
# wc_dat_daily <- subset(wc_dat, hour(datetimeUTC) == 12)
# wc_dat_daily_mean <- wc_dat_daily %>% dplyr::group_by(Name, Site, Treatment, Block, Triangle, Port) %>%
# dplyr::summarize(avg_value = mean(value, na.rm = TRUE), sd_value = sd(value, na.rm = TRUE))
# wc_dat_daily_mrd <- wc_dat_daily %>% dplyr::group_by(Site, Treatment, Port, datetimeUTC) %>%
# dplyr::mutate(sp_avg_value = mean(value, na.rm = TRUE), sp_sd_value = sd(value, na.rm = TRUE))
# wc_dat_daily_mrd$rd <- (wc_dat_daily_mrd$value - wc_dat_daily_mrd$sp_avg_value)/wc_dat_daily_mrd$sp_avg_value
# wc_dat_daily_mrd_mean <- wc_dat_daily_mrd %>% dplyr::group_by(Name, Site, Treatment, Block, Bl_Tri, Triangle, Port) %>%
# dplyr::summarize(avg_rd = mean(rd, na.rm = TRUE), sd_rd = sd(rd, na.rm = TRUE))
Grouped for each site/treatment pair with spatially averaged water content in black
From the spatial average for each site/treatment pair (0 Line in black)